import Vue from 'vue'
import App from './App.vue'

// 集成VueRouter插件
/**
  前5步(固定):
  1. 下载插件 yarn add vue-router@3.6.5
  2. 引入
  3. 注册使用
  4. 创建路由对象
  5. 注入, 放入new Vue({}), 建立关联
 */

import Find from './views/Find.vue'
import Friend from './views/Friend.vue'
import My from './views/My.vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)
const router = new VueRouter({
  // 配置路由关系映射表(对象数组)
  routes: [
    { path: '/find', component: Find },
    { path: '/friend', component: Friend },
    { path: '/my', component: My }
  ]
})

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
